package dfbz.com.service.impl;

import dfbz.com.dao.MeetingDao;
import dfbz.com.model.ConJoin;
import dfbz.com.model.Conference;
import dfbz.com.service.MeetingService;

import java.util.List;
import java.util.Map;

public class MeetingServiceImp implements MeetingService {
    private MeetingDao meetingDao = new MeetingDao();
    @Override
    public List showMeetingList(String current, String dep, String conTitle) {
      List list =  meetingDao.findMeetings(current,dep,conTitle);

        return list;
    }

    @Override
    public long findTotalCount(String dep, String conTitle) {
       Long total = meetingDao.findTotalCount(dep,conTitle);
        return total;
    }

    @Override
    public Conference findMeetingDetail(String id) {

       Conference con = meetingDao.findMeetingById(id);
        return con;
    }

    @Override
    public List findDeptMember(Integer deptId) {
       List list = meetingDao.findMemberByDeptId(deptId);
        return list;
    }



    @Override
    public Long findTotalMemberCount(Integer deptId) {
       Long total = meetingDao.findTotalCountByDeptId(deptId);
        return total;
    }

    @Override
    public void addMeeting(Conference conference) {
        meetingDao.addMeeting(conference);
    }

    @Override
    public Integer findDepId(String dep) {

       Integer id = meetingDao.findDepIdByDepName(dep);
        return id;
    }

    @Override
    public Long findTotalMeetingCount() {

      Long count =  meetingDao.findTotalMeetingCount();
        return count;
    }

    @Override
    public List findAllMemberIds(Integer id) {
       List list = meetingDao.findAllMemberIds(id);
        return list;
    }

    @Override
    public Integer findTotalConJoin() {
      Integer i =  meetingDao.findTotalConJoin();
        return i;
    }

    @Override
    public void addConJoin(ConJoin conJoin) {
        meetingDao.add(conJoin);
    }

    @Override
    public Integer findAbsentCount(String meetingId) {
        Integer c = meetingDao.findAbsentCount(meetingId);
        return c;
    }

    @Override
    public void changeConJoinStatus(String cId, String userId) {
        meetingDao.changeConJoinStatus(cId,userId);
    }
}
